package com.genghis.rapidcrm;

import com.genghis.rapidcrm.web.view.RapidFreeMarkerView;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver;

/**
 * @author xulixin
 */
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class QuickStartApplication {

    public static void main(String[] args) {
        SpringApplication.run(QuickStartApplication.class, args);
    }

    /** 自定义Freemarker视图，为视图添加特殊用途的变量和方法 */
    @Bean
    public CommandLineRunner applyRapidFreeMarkerView(FreeMarkerViewResolver resolver) {
        return strings -> resolver.setViewClass(RapidFreeMarkerView.class);
    }
}
